Method for guaranteeing a device minimum bandwidth on a USB bus

ABSTRACT

A method of guaranteeing a minimum sustained data transfer rate to a chosen device connected to a USB bus. A set of filter drivers are inserted in the driver stacks for at least two USB devices. These filter drivers are controlled by a filter driver controller that provides and receives information from the filter drivers. When a particular device needs a minimum sustained bandwidth for a transaction, the filter driver for that device notifies the filter driver controller. The filter driver controller then instructs the filter drivers for at least one other device to start interfering with USB transactions. This interference prevents the interfered with devices from using any of the USB bus bandwidth thereby providing a minimum sustained bandwidth to the non-interfered with device.

FIELD OF THE INVENTION

This invention relates generally to the Universal Serial Bus (USB) andmore particularly to ensuring that a minimum amount of bandwidth isallocated to a particular device.

BACKGROUND OF THE INVENTION

The Universal Serial Bus (USB) is a peripheral bus specificationdeveloped by personal computer (PC) and telecommunication industrycompanies that brings the plug and play features of computer peripheralsoutside the PC box. This eliminates the need to install cards intodedicated computer slots and reconfigure the system. Personal computersequipped with USB allow computer peripherals to be automaticallyconfigured as soon as they are physically attached. This eliminates theneed to reboot or run setup software. USB also allows multiple devicesto run simultaneously on a computer, with dedicated hubs and peripheralssuch as monitors and keyboards also acting as additional plug-in sites.

The Universal Serial Bus is defined in the Universal Serial BusSpecification, revision 1.1, Sep. 23, 1998 which is hereby incorporatedherein by reference. This document is available from the USBImplementers Forum web page at http://www.usb.org. Also underdevelopment is USB 2.0 which is intended to be fully compatible with USB1.1 and extend performance by up to 40 times over existing capabilitiesand use the same cables and connectors.

USB is implemented as a “shared” bus. In other words, there can bemultiple active devices connected to the USB bus with each active devicegetting a portion of the total available USB bandwidth. Unfortunately,this characteristic can cause problems with some types of devices. Forexample, a writeable compact disc drive, such as a CD-R or CD-RW drive,may use disc-at-once or track-at-once recording modes. In a disc-at-oncerecording mode, recording never stops until the entire disc has beencreated. In track-at-once, recording only stops at track boundaries. Thelimited availability of stopping times during recording can cause aproblem called “buffer underrun.” A buffer underrun occurs when the hostcomputer or bus cannot supply data to the drive at a rate at least equalto the speed that the drive is writing data to the media. To illustrate,if a drive capable of “4×” write speed, it can write data to the mediaat 600 kilobytes per second (KB/sec). Therefore, the host computer, andthe bus connecting the computer to the drive, must be able to sustain a600 KB/sec data transfer rate to the drive or the drive would require adata buffer that is too large to be practical. If the host computer andbus cannot sustain a 600 KB/sec data transfer rate, then the drive mayrun out of data when it is not a valid stopping point. This will causean error to occur and may ruin the media being written.

When drives or other devices with these type of limitations areconnected to a USB bus, they may be writing some media in one of themodes discussed above. If the user begins using another device on theUSB bus, the bandwidth available for the drive is reduced. If thisreduction in bandwidth is large enough, the bandwidth allocated to thedrive may not be enough to maintain the necessary sustained datatransfer rate to the drive and a buffer underrun error may occur.

Accordingly, there is a need in the art for a method and apparatus thatguarantees a minimum data transfer rate across a USB bus to and fromcertain devices. It is desirable that such method and apparatus be easyto implement from a user's point of view. It is also desirable that suchmethod and apparatus work with devices that conform to the USB devicespecifications so that existing and future devices and existing andfuture USB busses do not need to be redesigned or altered.

SUMMARY OF THE INVENTION

In a preferred embodiment, the invention provides a minimum sustaineddata transfer rate to a chosen device connected to a USB bus. A set offilter drivers are inserted in the driver stacks for at least two USBdevices. These filter drivers are controlled by a filter drivercontroller that provides and receives information from the filterdrivers. When a particular device needs a minimum sustained bandwidthfor a transaction, the filter driver for that device notifies the filterdriver controller. The filter driver controller then instructs thefilter drivers for at least one other device to start interfering withUSB transactions. This interference may be to temporarily delay one ormore transactions to one or more of the other devices until morebandwidth is available. This interference may also take the form ofintercepting transactions from one or more of the other devices andreturning an error condition. This interference may also be implementedby signaling the host computer that one or more of the other devices isdisconnected from the USB bus. Then when the non-interfered with deviceno longer needs the minimum sustained data rate, the host computer issignaled that the device has been reconnected. This interferenceprevents the interfered with devices from using any of the USB busbandwidth thereby providing a minimum sustained bandwidth to thenon-interfered with device. Other aspects and advantages of the presentinvention will become apparent from the following detailed description,taken in conjunction with the accompanying drawings, illustrating by wayof example the principles of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an illustration of devices connected to a USB bus including adevice that may need guaranteed minimum bandwidth.

FIG. 2 is an illustration of a set of USB driver stacks that guaranteeminimum bandwidth to a chosen device.

FIG. 3 is a flowchart illustrating steps taken to guarantee minimumbandwidth to a chosen device.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 is an illustration of devices connected to a USB bus including adevice that may need guaranteed minimum bandwidth. Computer 102 acts asthe USB host and also as a hub. A first USB port of computer 102 isconnected to keyboard/hub 108. Keyboard/hub 108 has USB hubfunctionality so multiple USB devices are connected to the ports ofkeyboard/hub 108. The devices connected to the USB ports on keyboard/hub108 are speaker 104, speaker 106, and mouse 110. A second USB port ofcomputer 102 is connected to laser printer/hub device 112. Opticaldrive/hub device 114 is connected to a USB port on laser printer/hubdevice 112. Finally, a modem 116 is connected to a USB port on opticaldrive/hub device 114.

As discussed above, one of these devices may need a guaranteed minimumbandwidth to function properly. For example, optical drive/hub 114 maybe performing a disc-at-once write operation. If this is the case, andoptical drive/hub 114 writes at 600 KB/sec, it will need at least thatamount of bandwidth on the USB bus to avoid buffer underrun. Toguarantee this minimum amount of bandwidth, filter drivers are insertedinto the USB driver stacks running on computer 102. These filter driversare controlled by a filter controller that provides and receivesinformation from the filter drivers.

FIG. 2 is an illustration of a set of USB driver stacks that guaranteeminimum bandwidth to a chosen device. There is a USB driver stackcorresponding to each device that is connected to the USB bus. The firstdriver stack shown comprises USB driver 210, bandwidth filter driver220, and USB driver 230. USB driver 210 communicates with bandwidthfilter driver 220. Bandwidth filter driver 220 also communicates withUSB driver 230. USB driver 230 also communicates with bus driver 240.Information on how to construct a filter driver is given in chapter 30of Developing Windows NT Device Drivers: a programmer 's handbook byEdward N. Dekker, Addison Wesley Longman, Inc., copyright 1999, which ishereby incorporated herein by reference. This book also contains usefulinformation on the operation of USB and other device drivers. Inparticular, chapter 29 relates to the Universal Serial Bus and istherefore hereby incorporated herein by reference.

The second driver stack is the driver stack corresponding to the devicethat needs a minimum amount of bandwidth. In the case discussed above,this would be the driver stack that is associated with optical drive/hub114. The second driver stack shown comprises USB driver 212, chosendevice filter driver 222, and USB driver 232. USB driver 212communicates with chosen device filter driver 222. Chosen device filterdriver 222 also communicates with USB driver 232. USB driver 232 alsocommunicates with bus driver 240. The third driver stack shown comprisesUSB driver 214, bandwidth filter driver 224, and USB driver 234. USBdriver 214 communicates with bandwidth filter driver 224. Bandwidthfilter driver 224 also communicates with USB driver 234. USB driver 234also communicates with bus driver 240. The fourth driver stack showncomprises USB driver 216, bandwidth filter driver 226, and USB driver236. USB driver 216 communicates with bandwidth filter driver 226.Bandwidth filter driver 226 also communicates with USB driver 236. USBdriver 236 also communicates with bus driver 240.

Bandwidth filter drivers 220, 224, and 226 all communicate with and arecontrolled by bandwidth filter controller 202. Bandwidth filtercontroller 202 also communicates with and controls chosen device filtercontroller 222.

FIG. 3 is a flowchart illustrating steps taken to guarantee minimumbandwidth to a chosen device. In a step 302, the system is initializedby inserting bandwidth filter drivers, a chosen device filter driver ordrivers, and a bandwidth filter controller into the operating systemdriver stacks. After this initialization, in a step 304, all the filterdrivers and the filter driver controller wait for an operation requiringminimum bandwidth. While they wait, the filter drivers operate normallyand communicate with the other USB drivers without interfering with theflow of communications between these drivers. When an operation isrequested that needs minimum bandwidth, a chosen device filter drivercontroller reports that need to the bandwidth filter controller in astep 306. Alternatively, the bandwidth filter controller could determineitself that a minimum sustained bandwidth is required and notifies thefilter drivers. Another alternative is that an application program, suchas a CD mastering application, determines that a minimum sustainedbandwidth is needed and the application program reports that need to thebandwidth filter controller directly for relay to the filter drivers. Ina step 308, after receiving this report, the bandwidth filter controllerinstructs one or more bandwidth filter drivers to interfere withtransactions. This interference prevents at least some bus traffic fromactually reaching the USB bus. By reducing this traffic, it guaranteesthat a minimum bandwidth is available for the chosen device. The numberof devices that would have their transactions reduced, or blocked, woulddepend upon how much bandwidth the various devices are using.

One embodiment of the present invention guarantees minimum bandwidth forthe chosen device by interfering with a predetermined set of the otherdevices on the USB bus. For example, all of the devices except for thekeyboard and mouse may be interfered with. This would guarantee most ofthe available bandwidth to the chosen device because keyboards and micegenerally do not use much bandwidth and it is desirable that the devicescontinue to function at all times. In one embodiment, the interferencetakes the form of reporting back to the system that a device has beendisconnected from the bus. This “virtual disconnection” takes place onlyin the driver stacks and is accomplished by the bandwidth filtercontrollers reporting a disconnect condition even though one does notactually exist. Since the higher level USB drivers and the system thenbelieve that the device is no longer present, they will stop trying tosend information to that device across the USB bus.

Other forms of interference that may be used are to temporarily delayone or more transactions to one or more of the other devices until morebandwidth is available. Another form of interference that may be usedtakes the form of intercepting transactions from one or more of theother devices and returning an error condition.

In a step 310, the bandwidth filter controllers continue to interferewith USB transactions until the minimum bandwidth operation is complete.During this waiting period, the chosen device filter controllercontinues to pass transactions between USB drivers in a normal manner.This allows the chosen device to use all of the available bandwidth onthe USB bus.

In a step 312, after the minimum bandwidth operation has completed, thebandwidth filter driver controller instructs the bandwidth filterdrivers to resume normal operation. In the embodiment discussed above,the bandwidth filter drivers would then signal the system that thedevices are reconnected and need to be reset. The system would then takeappropriate action to restore these devices to normal operation. Afterthis step, the system would return to step 304 and wait for anotheroperation that requires minimum bandwidth.

From the foregoing it will be appreciated that the invention provides anovel and advantageous way of guaranteeing minimum bandwidth on a USBbus. This system may be configured to provide some bandwidth to missioncritical devices if there is bandwidth to spare, or may use a dynamicapproach that only interferes with devices that are using too muchbandwidth, either alone or in combination, to coexist with the minimumbandwidth operation. Finally, this invention may be implemented entirelyin software and can be made transparent to both the operating system andthe other device drivers.

Although several specific embodiments of the invention have beendescribed and illustrated, the invention is not to be limited to thespecific forms or arrangements of parts so described and illustrated.The invention is limited only by the claims.

1-23. (cancelled)
 24. An apparatus for providing a minimum sustaineddata rate across a USB bus, comprising: a bandwidth filter driverassociated with a device; and, a chosen device bandwidth filter driver,wherein said chosen device bandwidth filter causes said bandwidth filterdriver to transmit at least one signal indicating that said device isnot connected to said USB bus regardless of whether said device isconnected to said USB bus.
 25. An apparatus for providing a minimumsustained data rate across a USB bus, comprising: a bandwidth filterdriver associated with a device; and, a chosen device bandwidth filterdriver, wherein said chosen device bandwidth filter causes saidbandwidth filter driver to transmit at least one signal indicating thatan error condition exists on said device, whether or not an error existson said device.